#include "DiamondData.h"

void load_DiamonDataRow_file(istream& in, vector<DiamondDataRow>* out)
{
  char l_buf[128];
  while (in.getline(l_buf, sizeof(l_buf))) {
    istringstream lin(l_buf);
    DiamondDataRow dr;
    double weight, price;
    string color, clarity, cert;
    lin >> weight >> color >> clarity >> cert >> price;
    dr.weight = weight;
    dr.color[0] = color[0];
    strncpy(dr.clarity, clarity.c_str(), 4);
    strncpy(dr.cert, cert.c_str(), 3);
    dr.price = price;
    out->push_back(dr);
  }
}
